<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
</style>
<script src="/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=25cc9404b6bb8d97da87d92a10e7f80d"></script>
<title>查看路线</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
	$(document).ready(function () {
		slx=getUrlParam("slx");
		sly=getUrlParam("sly");
		tlx=getUrlParam("tlx");
		tly=getUrlParam("tly");
		// 百度地图API功能
		var map = new BMap.Map("allmap");
		map.centerAndZoom(new BMap.Point(slx, sly), 11);
		
		var p1 = new BMap.Point(slx,sly);
		var p2 = new BMap.Point(tlx,tly);
		
		var driving = new BMap.DrivingRoute(map, {renderOptions:{map: map, autoViewport: true}});
		driving.search(p1, p2);
	});
	
	function getUrlParam(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	    		var r = window.location.search.substr(1).match(reg); 
	    		if (r != null) return unescape(r[2]); return null;
	    }
</script>